package com.wf.classRoomTest.staticcc;

import java.util.concurrent.TimeUnit;

/**
 * @Author fengqq
 * @Description 核心业务逻辑
 * @Date 2024/6/19  15:14
 */
public class UserService implements IUserService{
    @Override
    public boolean login(String username, String password) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        if("admin".equals(username) && "admin".equals(password)){
            return true;
        }
        return false;
    }

    @Override
    public boolean register(String username, String password, int age) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("插入用户数据中....username="+username+",age="+age);
        return true;
    }
}
